package com.manlitech.cloudboot.common.enums;

public enum ResultEnums {
	
	/*成功返回*/
    SUCCESS(0, "成功"),
    SUCCESS_LOGOUT(1, "退出成功，期待下次使用本系统"),
    /*特殊异常*/
    UNKONW_ERROR(-1, "呀，服务器开小差了~"),
    //登录相关
    NO_LOGIN(-2,"用户信息不存在。可能未登录"), 
    NO_LOGIN_ERR_LOGIN_Info(-3,"用户名密码错误或信息不存在,请核对"),
    NO_LOGIN_REFRESH_TOKEN_IS_EXPIRE(-4,"refresh_token已经失效"),
    ERROR_TOKEN(-5,"token验证失败"),
    ERROR_PERMISSION(-6,"无访问权限"),
    /* 异常相关 */
	UNKONW_REDIS_TYPE(-7,"redis类型[单机,集群]未知"),
    SQL_INJECTION(-8,"警告:sql存在注入风险"),
    NO_FOUND_QUEUE_NAME_JOB (-9,"未找到相对应的队列名称"),
    ERROR_GATEWAY (-10,"网关异常提示"),
    API_FLOW_EXCEPTION (-11,"服务繁忙,请重试,服务限流") ,
    API_DEGRADE_EXCEPTION(-12,"服务繁忙,请重试,服务降级"),
    API_PARAM_HOT_FLOW_EXCEPTION(-13,"服务繁忙,请重试,热点参数限流"),
    API_SYSTEM_BLOCK_EXCEPTION(-14,"服务繁忙,请重试,系统规则（负载/...不满足要求）"),
    API_AUTHORITY_EXCEPTION(-15,"授权规则不通过");
    private Integer code;

    private String msg;

    ResultEnums(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
